/**
 * 
 */
package com.sesame.daoimpl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sesame.dao.CollectDAO;
import com.sesame.domain.Collect;

/**
 * @author voidman
 * 
 */
public class CollectDAOImpl extends SqlMapClientDaoSupport implements CollectDAO {

    public void addCollect(Collect Collect) {
        getSqlMapClientTemplate().insert("addCollect", Collect);
    }

    public void deleteCollectById(Integer id) {
        getSqlMapClientTemplate().delete("deleteCollectById", id);
    }

    @SuppressWarnings("unchecked")
    public List<Collect> getAllCollect() {
        List<Collect> listCollect;
        listCollect = getSqlMapClientTemplate().queryForList("getAllCollect");
        return listCollect;
    }
    
    public Collect getCollectById(Integer id) {

        return (Collect) getSqlMapClientTemplate().queryForObject("getCollectById", id);
    }

    public void updateCollect(Collect Collect) {
        getSqlMapClientTemplate().update("updateCollect", Collect);
    }

}
